home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)t6.d64
/
hex puzzle.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
3KB
|
89 lines
1 REM BY BRUCE JORDAN
2 REM COMPUTE DECEMBER 1983
100 POKE53280,0 :POKE53281,0:POKE55,176:POKE56,29:CLR:POKE54276,8:POKE54283,8
110 POKE54277,0:POKE54278,255:POKE54284,0:POKE54285,255:POKE54296,15
120 S=1355:SC=S+54272:DIMA$(16)
130 PRINT"[147]":G=1632:X=0:DX=1:P=55904:S1=54276:S2=54283:AD=1232:R=14
140 PRINT"[147]"TAB(11)"HEX NUMBER PUZZLE"TAB(51)"[144]"
150 :
160 :
170 REM
180 PRINT" DO YOU WANT A TIME LIMIT?";:GOSUB270
190 IFIN$<>"Y"THEN240
200 H=1:INPUT"HOURS MINS SECS 123456";T$:IFLEN(T$)<>6THEN200
210 IFLEFT$(T$,2)>"23"ORLEFT$(T$,2)<"0"THEN200
220 IFMID$(T$,3,2)>"59"ORMID$(T$,3,2)<"0"THEN200
230 IFRIGHT$(T$,2)>"59"ORRIGHT$(T$,2)<"0"THEN200
240 PRINT" KEY FOR UP: ";:GOSUB270:U$=IN$:PRINT" FOR DOWN: ";:GOSUB270:D$=IN$
250 PRINT" FOR LEFT: ";:GOSUB270:L$=IN$:PRINT" FOR RIGHT: ";:GOSUB270:R$=IN$
260 GOTO310
270 PRINT"[219]";:WAIT198,255:GETIN$:PRINT"[157]";:POKE216,1:PRINTN$:RETURN
280 :
290 :
300 REM FIND GOAL ORDER
310 PRINT"[147]"TAB(43)"ENTER GOAL SETUP"
320 PRINT" 1 2 3 4 5 6 7 8 9"SPC(23)"A B C D E F "
330 PRINTTAB(5)"IN ANY ORDER":PRINTTAB(248)"GOAL
340 [129]K[178]0[164]3:[151]1592[170]K,100:[151]1792[170]K,99:[151]55864[170]K,R:[151]56064[170]K,R
350 [151]1631[170]K[172]40,103:[151]1636[170]K[172]40,101:[151]55903[170]K[172]40,R:[151]55908[170]K[172]40,R:[130]
360 [129]I[178]1[164]16:[151]G[170]X,63:[151]P[170]X,1
370 [146]198,255:[161]A$(I):[129]L[178]I[171]1[164]0[169][171]1:[139]A$(I)[178]A$(L)[167]370
380 [130]:[139]A$(I)[178]" "[167][129]K[178]0[164]4:[151]55471[170]K,0 :[130]:B2[178]32:[137]420
390 [139](A$(I)[179]"1"[176]A$(I)[177]"F")[176](A$(I)[177]"9"[175]A$(I)[179]"A")[167]370
400 B[178][197](A$(I)):B2[178]B[170]48:[139]B[167][151]55417[170]2[172]B,0 :[137]420
410 B[178][198](A$(I))[171]64:B2[178]B:[151]55457[170]2[172]B,0
420 [151]G[170]X,B2:X[178]X[170]DX:[139]X[178]4[167]G[178]G[170]40:P[178]P[170]40:X[178]0
430 [130]
440 :
450 :
460 [143]
470 [153]"":[129]I[178]0[164]64:[153]" ";:[130]:[153]""[163]127)"PUZZLE"
480 [129]K[178]0[164]3:[151]1192[170]K,100:[151]55464[170]K,R:[151]1392[170]K,99:[151]55664[170]K,R
490 [151]1231[170]K[172]40,103:[151]55503[170]K[172]40,R:[151]1236[170]K[172]40,101:[151]55508[170]K[172]40,R:[130]
500 [135]A,B,C:[139]A[177][178]0[167][151]AD[170]A,B:[151]55504[170]A,C:[137]500
510 [129]I[178]1[164]500:[130]:[151]S1[171]3,80:[151]S1,33:[153]""[163]28)"!GO!CONT"
520 [129]T[178]1[164]300:[130]:[153]""[163]28)" ":[151]S1,8:TI$[178]"000000"
530 [153]""[163]25)"LIMIT:OPEN";:[139]T$[178]""[167][153]"NONE":[137]580
540 [153][200](T$,2)":"[202](T$,3,2)":"[201](T$,2)"CONT"
550 :
560 :
570 [143]
580 [153]"TIME ELAPSED:"[200](TI$,2)":"[202](TI$,3,2)":"[201](TI$,2)"CONT"
590 [139]H[178]1[175]T$[179][178]TI$[167]750
600 [161]B$:J[178]31[171][194](56320)[175]31:[139]B$[178]""[175]J[178]0[167]580
610 [139]B$[178][199](13)[176]J[178]16[167]WN[178]0:[137]780
620 [139]B$[178]D$[176](J[175]2)[167]DR[178][171]40:CK[178]100:[137]660
630 [139]B$[178]L$[176](J[175]4)[167]DR[178]1:CK[178]101:[137]660
640 [139]B$[178]R$[176](J[175]8)[167]DR[178][171]1:CK[178]103:[137]660
650 DR[178]40:CK[178]99:[139]B$[179][177]U$[175](J[175]1)[178]0[167]580
660 [139][194](S[170]DR)[178]CK[167]580
670 [151]S,[194](S[170]DR):[151]SC,[194](SC[170]DR):[151]S[170]DR,32:S[178]S[170]DR:SC[178]SC[170]DR
680 [129]M[178]0[164]120[169]40:[129]N[178]0[164]3:W[178][194](AD[170]M[170]N)[175]127:[139]W[179][177][194](1632[170]M[170]N)[167]580
690 [130]:[130]:[153]""[163]24)"OPENYOU WIN!CONT":[151]S1[171]3,0:[151]S1,33:WN[178]1
700 [135]N1,N2,D:[139]N1[178][171]1[167][151]S1,8:[137]780
710 [151]S1[171]4,N1:[151]S1[171]3,N2:[129]T[178]1[164]D:[130]:[137]700
720 :
730 :
740 [143] END
750 [153]""[163]23)"!YOU LOSE!CONT":[151]S1[171]3,10:[151]S1,17:WN[178]1
760 [151]S2[171]3,60:[151]S2,129:[129]T[178]1[164]300:[130]:[151]S2,8:[151]S1,8
770 :
780 TM$[178]TI$:[153]""[163]21)"(1) RESET
790 PRINTTAB(21)"(2) QUIT":IFWN=0THENPRINTTAB(21)"(3) AS YOU LEFT IT"
800 GETV$:IFV$<"1"ORV$>"3"THEN800
810 IFV$="1"THENRUN
820 IFV$="2"THENEND
830 IFWNTHEN800
840 PRINT"":FORI=1TO6:PRINTTAB(21)" ":NEXT
850 TI$=TM$:GOTO580
860 :
870 :
890 REM SETUP MUSTIC AND DATA
895 DATA0,49,1,1,178,3,2,51,1,3,180,3
900 DATA40,53,1,41,182,3,42,55,1,43
910 DATA184,3,80,57,1,81,129,3,82,2,1
920 DATA83,131,3,120,4,1,121,133,3,122
930 DATA6,1,123,32,3,-1,-1,-1
940 DATA96,22,150,0,0,50,96,22,75,0,0,50,96,22,75,49,28,175,96,22,115,49,28
950 DATA175,135,33,250,0,0,0,-1,-1,-1